﻿using System;
using System.Collections.Generic;
using System.Linq;
using Database.Context;
using Database.Models;

namespace QuanLyThongTinCoSo.Biz
{
    public class NhomHanhViBiz:BaseBiz
    {
        public NhomHanhViBiz()
        {
            DbContext = new Context();
        }

        public NhomHanhViBiz(Context context)
        {
            DbContext = context;
        }

        public override void Insert(BaseModel model)
        {
            throw new NotImplementedException();
        }

        public override void Update(BaseModel model)
        {
            throw new NotImplementedException();
        }

        public override void Delete(BaseModel model)
        {
            throw new NotImplementedException();
        }

        public override void DeleteItems(List<BaseModel> models)
        {
            throw new NotImplementedException();
        }

        public override BaseModel GetItemById(int id)
        {
            return (from item in DbContext.NhomHanhVis
                    where item.Id == id
                    select item).First();
        }

        #region GetAll

        public List<NhomHanhVi> GetAll()
        {
            return DbContext.NhomHanhVis.OrderBy(p => p.Ten).ToList();
        }

        #endregion
    }
}
